<?php
namespace Home\Controller;

class DataController extends HomeController {
 

   public function index(){

        $info = M('Tuba')->where('mark=0')->order('create_time desc')->select();
        $size = sizeof($info)/5;
        $this->assign('size',ceil($size));
        $this->assign('info',$info);
        $this->display();
	}

    public function information(){
        $list = M('Tuba')->where('mark=0')->order('create_time desc')->select();
        $size = sizeof($list)/5;
        $this->assign('size',ceil($size));
        $this->assign('list', $list);
        $this->display();
    }
    public function dynamic(){
        $list = M('Tuba')->where('mark=1')->order('create_time desc')->select();
        $size = sizeof($list)/5;
        $this->assign('size',ceil($size));
        $this->assign('list', $list);
        $this->display();
    }

    public function detail(){
        $id = I('id','');
        $map['id'] = $id;
        $data = M('Tuba')->where($map)->find();
        $this->assign('data', $data);
        $this->display();
     }

}